package com.bs.alibabauserproducer.controller;

import com.bs.alibabauserproducer.pojo.Account;
import com.bs.alibabauserproducer.service.AccountService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @Author: Tvemic⁹
 * @DateTime: 2022/7/5 9:30
 * @Description: TODO
 */

@RestController
@RequestMapping("/account02")
public class AccountController {

    @Resource
    AccountService accountService;

    @RequestMapping(value = "/send",method = RequestMethod.POST)
    public Account sendAccount(){
        Account ac = new Account();
        ac.setAccountNo("2");
        ac.setAccountBalance(1000);
        return ac;
    }

    @RequestMapping(value = "/edit",method = RequestMethod.POST)
    public int updAccount(Account account){
        account = sendAccount();
        System.out.println(account);
        return accountService.updateAccountInfo(account);
    }
}
